-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Remove DefId from EarlyParamRegion
#125468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
DefId from EarlyRegionParamDefId from EarlyParamRegion
eafea35 to
5451787
Compare
compiler-errors
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally very happy with this change 👍 ✨
compiler/rustc_infer/src/infer/error_reporting/nice_region_error/util.rs
Outdated
Show resolved
Hide resolved
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
🤔 also would like to know why those tests no longer ICE. I might be able to investigate tomorrow if you end up not being able to find out why, just lemme kno |
|
Oh god why does this make tests no longer ICE 😭 |
5451787 to
0946cb8
Compare
This comment has been minimized.
This comment has been minimized.
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
|
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (8210bd9): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results (secondary -3.7%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary -1.4%, secondary 0.8%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResults (primary -0.3%, secondary -0.9%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 671.784s -> 671.214s (-0.08%) |
|
TODO: I owe Boxy a detailed explanation for the "regression" (tests that ICE -> pass) which I'll have by the end of my day here hopefully. Then we can land this 🎉 |
|
thinking emoji @bors retry |
|
A job failed! Check out the build log: (web) (plain) Click to see the possible cause of the failure (guessed by this bot) |
|
💔 Test failed - checks-actions |
|
CI is broken, see this zulip thread. I guess we should just wait a little bit... @bors r- |
|
@bors r+ |
|
🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened. |
|
5th times the charm lol :") |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (fec98b3): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results (primary -0.9%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary -1.4%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResults (primary -0.3%, secondary -0.9%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 669.538s -> 668.124s (-0.21%) |
Currently we represent usages of
Regionparameters via theReEarlyParamorReLateParamvariants. TheReEarlyParamis effectively equivalent toTyKind::ParamandConstKind::Param(i.e. it stores aSymboland au32index) however it also stores aDefIdfor the definition of the lifetime parameter.This was used in roughly two places:
body_iddown to relevant locations. Interestingly there were already some places that had to pass down aDefIdmanually.DefIdfield to track captured lifetimesI've split this PR up into a commit for generate rote changes to diagnostics code to pass around a
DefIdmanually everywhere, and another commit for the opaque type related changes which likely require more careful review as they might change the semantics of lints/errors.Instead of manually passing the
DefIdaround everywhere I previously tried to bundle it in withTypeErrCtxtbut ran into issues with some call sites ofinfcx.err_ctxtbeing unable to provide aDefId, particularly places involved with trait solving and normalization. It might be worth investigating adding some new wrapper type to pass this around everywhere but I think this might be acceptable for now.This pr also has the effect of reducing the size of
EarlyParamRegionfrom 16 bytes -> 8 bytes. I wouldn't expect this to have any direct performance improvement however, other variants ofRegionKindover8bytes are all because they contain aBoundRegionKindwhich is, as far as I know, mostly there for diagnostics. If we're ever able to remove this it would shrink theRegionKindtype from24bytes to12(and with clever bit packing we might be able to get it to8bytes). I am curious what the performance impact would be of removing interning ofRegion's if we ever manage to shrinkRegionKindthat much.Sidenote: by removing the
DefIdtheDebugoutput forRegionhas gotten significantly nicer. As an example see this opaque type debug print before vs after this PR:Opaque(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::{opaque#0}), [DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a)_'a/#0, T, DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a)_'a/#0])Opaque(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::{opaque#0}), ['a/#0, T, 'a/#0])r? @compiler-errors (I would like someone who understands the opaque type setup to atleast review the type system commit, but the rest is likely reviewable by anyone)